import os

#启动节点指令变量
stere_camera_driver="ros2 launch stereo_camera_driver start_camera_launch.py"
hikvision_ros2_driver="ros2 launch hikvision_ros2_driver standalone.launch.yaml camera_name:='hkcamera'"
realsense2_camera_multi="ros2 launch realsense2_camera rs_multi_camera_launch.py serial_no1:='112222070933' serial_no2:='052622071155' serial_no3:='948122072553'"
realsense2_camera_rs_3="ros2 launch realsense2_camera rs_3_camera_launch.py serial_no1:='112222070933' serial_no2:='052622071155' serial_no3:='948122072553'"
rlrob_forcesensor_driver="ros2 launch rlrob_forcesensor_driver force_sensor_driver.launch.py"
rlrob_robot_driver="ros2 launch rlrob_robot_driver rlrob_robot_driver.launch.py"
piece_detection="ros2 launch piece_detection piece_detection.launch.py"
dual_air4a_moveit_config="ros2 launch dual_air4a_moveit_config demo.launch.py run_mode:='arcs'"
dual_arm_task="ros2 launch dual_arm_task dual_arm_task.launch.py"
ual_arm_utils="ros2 launch dual_arm_task dual_arm_utils.launch.py"
#tab标题
stere_title="stere_camera_driver"
hikvision_title="hikvision_ros2_driver"
realsense2_multi_title="realsense2_camera_multi"
realsense2_rs_3_title="realsense2_camera_rs_3"
forcesensor_driver_title="rlrob_forcesensor_driver"
robot_driver_title="rlrob_robot_driver"
piece_detection_title="piece_detection"
air4a_moveit_config_title="dual_air4a_moveit_config"
arm_task_title="dual_arm_task"
arm_utils_title="ual_arm_utils"

#一个终端界面打开5个tab
cmd=f"gnome-terminal --window --title=\"{stere_title}\" -e \"{stere_camera_driver}\"\
    --tab --title=\"{hikvision_title}\" -e \"{hikvision_ros2_driver}\"\
    --tab --title=\"{realsense2_multi_title}\" -e \"{realsense2_camera_multi}\"\
    --tab --title=\"{realsense2_rs_3_title}\" -e \"{realsense2_camera_rs_3}\"\
    --tab --title=\"{forcesensor_driver_title}\" -e \"{rlrob_forcesensor_driver}\"\
    --window --title=\"{robot_driver_title}\" -e \"{rlrob_robot_driver}\"\
    --tab --title=\"{piece_detection_title}\" -e \"{piece_detection}\"\
    --tab --title=\"{air4a_moveit_config_title}\" -e \"{dual_air4a_moveit_config}\"\
    --tab --title=\"{arm_task_title}\" -e \"{dual_arm_task}\"\
    --tab --title=\"{arm_utils_title}\" -e \"{ual_arm_utils}\""

os.system(cmd)